﻿using System;
using System.Collections.Generic;

namespace LL.Common
{
    public class TreeNodeWrapper<T>
        where T : ITree, IDisplay, IIdentity<Guid>
    {
        public T Item { get; set; }

        public TreeItem<T> Parent { get; set; }

        public IList<TreeNodeWrapper<T>> Children { get; set; }

        public string Text { get { return Item.Name; } }
        public string Value { get { return Item.Id.ToString(); } }
    }

    public class TreeNodeWrapper<T, TItem>
        where T : ITree, IDisplay, IIdentity<Guid>
    {
        public T Item { get; set; }

        public TreeItem<T> Parent { get; set; }

        public IList<TreeNodeWrapper<T, TItem>> Children { get; set; }

        public IList<TItem> Items { get; set; }

        public string Text { get { return Item.Name; } }
        public string Value { get { return Item.Id.ToString(); } }
    }
}